<?php 

if (!empty($_POST)) die;

$auth = $_SESSION['auth'];
if (empty($auth)) { 
	header('Location:?c=user&a=login');
	die;
}

$lmcys = dt_query("SELECT id, name FROM finance_lmcy ORDER BY c_at");
if (!$lmcys) die('获取数据失败！');

$pre_invest = dt_query_one("SELECT * FROM finance_pre_invest WHERE user_id = ".$auth['id']);

?>
<?php require_once('finance/inc/nav_sub_xm.html') ?>
<div class="container finance-item-add" style="padding-top:15px">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<h3><span class="glyphicon glyphicon-edit"></span> 预留投资意向</h3>
			<hr class="solid">
			<div class="alert alert-info">
				<b>注意：</b>
				<ol>
					<li>留下您对项目的投资期望，我们为您推荐合适的项目。</li>
					<li>请放心，我们跟您一样痛恨骚扰电话，我们只会在项目符合您要求的情况下，挑选不影响您正常工作和休息的时间段联系您。</li>
				</ol>
			</div>
			<div class="col-md-11 column">
				<form class="form-horizontal" action="?c=finance&a=do_pre_invest" method="post">
					<fieldset>
						<!-- Text input-->
						<div class="form-group">
							<label class="col-md-2 control-label">意向投资描述</label>  
							<div class="col-md-7">
								<textarea name="des" type="text" placeholder="我想投资产品技术成熟的科技企业扩大生产型融资项目，股权型债权型皆可。" class="form-control" rows="5"  required=""><?php echo $pre_invest['des'] ?></textarea>
								<span class="help-block">简单的描述您的投资期望，我们会通过各种模型对您的描述进行分析，精准得出您的投资偏好，并以此为依据，为您推荐项目。</span>
							</div>
						</div>
						<!-- Text input-->
						<div class="form-group">
							<label class="col-md-2 control-label">意向投资额</label>  
							<div class="col-md-7">
								<input name="money" type="text" placeholder="500000" class="form-control input-md" required="" value="<?php echo $pre_invest['money'] ?>">
								<span class="help-block">您愿意投入的资金量。</span>
							</div>
						</div>
						<!-- Text input-->
						<div class="form-group">
							<label class="col-md-2 control-label">机构选择</label>  
							<div class="col-md-7">
								<select name="lmcy_id" class="form-control">
									<?php while($lmcy = mysql_fetch_array($lmcys)) { ?>
									<option value="<?php echo $lmcy['id'] ?>" <?php if ($lmcy['id'] == $pre_invest['lmcy_id']) echo 'selected="selected"' ?>><?php echo $lmcy['name'] ?></option>
									<?php } ?>
								</select>
								<span class="help-block">这是为您服务的投融资服务机构。</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-2 control-label">联系电话</label>  
							<div class="col-md-7">
								<input name="phone" type="text" placeholder="158****8888" class="form-control input-md" required="" value="<?php echo $pre_invest['phone'] ?>">
								<span class="help-block">我们的专业人员通过这个号码与您联系。</span>
							</div>
						</div>

						<!-- token -->
						<input type="hidden" name="token" value="<?php echo get_token() ?>"/>

						<!-- Button -->
						<div class="form-group">
							<label class="col-md-2 control-label"></label>
							<div class="col-md-2">
								<button class="btn btn-primary btn-block">提交意向</button>
							</div>
							<div class="col-md-5">
								<a class="btn btn-success btn-block" type="button" href="?c=finance&a=item_list">项目列表</a>
							</div>
						</div>

					</fieldset>
				</form>	


			</div>
		</div>
	</div>
</div>
<script type="text/javascript">

$(document).ready(function(){
	$('li#finance_xm').addClass('active');
	$('li#xm_tzyx').addClass('active');
});

</script>
